<template>
    <div class="">
        <h1>Father Component</h1>
        <ChildrenComponent :list="userList">
            <template v-slot:default="slotProps"> 
                父组件接收到子组件遍历时的用户对象：{{ slotProps.userObject.id }}
            </template>
        </ChildrenComponent>
    </div>
</template>
<script>

import ChildrenComponent from './ChildrenComponent.vue';

export default {
    name: 'FatherComponent',
    data () {
        return {
            userList: [
                {
                    name: '张三',
                    age: 20,
                    id: 1,
                },
                {
                    name:'李四',
                    age: 21,
                    id: 2,
                },
                {
                    name: '王五',
                    age: 22,
                    id: 3,
                },
            ],
        };
    },
    mounted: function () {
    },
    components: {
        ChildrenComponent,
    },
    methods: {
        add() {
            
        },
    }
};
</script>
<style scoped>
    
</style>